package main

import (
	"fmt"
	"learn-golang/day08/bean"
)

func main() {
	// 格式一：创建对象
	/*student1 := bean.Student{}
	student1.Name = "张三"
	student1.Age = 23
	student1.PassWord = "123456"
	fmt.Println(student1)

	// 格式二：直接传参
	student2 := bean.Student{Name: "李四", Age: 24, PassWord: "654321"}
	fmt.Println(student2)*/

	// 属性修改
	student1 := bean.Student{}
	student1.Name = "张三"
	student1.Age = 23
	student1.PassWord = "123456"
	fmt.Println(student1)
	student1.Age = 66
	fmt.Printf("正常修改变量值：%v\n", student1)
	student1.SetName("王五")
	fmt.Printf("函数修改变量值：%v\n", student1)
	(&student1).PassWord = "999999"
	fmt.Printf("指针修改变量值：%v\n", student1)
}
